Ok so how do I define the member functions? Here's what I've got so far:
Code:
class Demo {
float m_Angle;
float m_Red;
float m_Green;
float m_Blue;
char m_Buffer[30];
int m_Width;
int m_Height;
int m_Frame;
int m_Time;
int m_Timebase;
char m_FPS[10];
FMOD_RESULT m_Result;
FMOD::System *m_FMOD_System;
FMOD::Channel *m_Channel;
FMOD::Sound *m_Sound;
public:
static Demo *Instance ();
static void renderString (float x, float y, void *font, char *str);
void playSound ();
void setOrthoProjection ();
void resetPerspectiveProjection ();
static void render ();
static void reshape (int w, int h);
// GLUT Handler functions
static void normalKeys (unsigned char key, int x, int y);
static void specialKeys (int key, int x, int y);
static void mousePress (int button, int state, int x, int y);
static void mousePassiveMotion (int x, int y);
protected:
Demo ();
Demo (const Demo &);
Demo &operator= (const Demo &);
};
And this is as far as I've gotten with implementation:
Code:
// playSound
void playSound ()
{
m_Result = m_FMOD_System->playSound (FMOD_CHANNEL_FREE, m_Sound, false, 0);
if (m_Result != FMOD_OK) {
MessageBox (0, "Error playing sound", "FMOD Error",
MB_OK | MB_ICONEXCLAMATION);
exit (1);
}
}
Errors:
Code:
------ Build started: Project: engineDemo, Configuration: Debug Win32 ------
Compiling...
Demo.cpp
c:\Documents and Settings\lee\Desktop\engineDemo\Demo.cpp(31) : error C2065: 'm_Result' : undeclared identifier
c:\Documents and Settings\lee\Desktop\engineDemo\Demo.cpp(31) : error C2065: 'm_FMOD_System' : undeclared identifier
c:\Documents and Settings\lee\Desktop\engineDemo\Demo.cpp(31) : error C2227: left of '->playSound' must point to class/struct/union
type is ''unknown-type''
c:\Documents and Settings\lee\Desktop\engineDemo\Demo.cpp(31) : error C2065: 'm_Sound' : undeclared identifier
c:\Documents and Settings\lee\Desktop\engineDemo\Demo.cpp(32) : error C2679: binary '!=' : no operator found which takes a right-hand operand of type 'FMOD_RESULT' (or there is no acceptable conversion)
c:\Documents and Settings\lee\Desktop\engineDemo\Demo.cpp(32) : error C3861: 'm_Result': identifier not found, even with argument-dependent lookup
Generating Code...
Compiling...
engineDemo.cpp
Generating Code...
Build Time 0:00
Build log was saved at "file://c:\Documents and Settings\lee\Desktop\engineDemo\Debug\BuildLog.htm"
engineDemo - 6 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
Sorry to dump all this on the reader but I'm completely stumped.